from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt


@csrf_exempt
def backendlogin(request):
    response = {}
    try:
        username = request.GET.get('username')
        password = request.GET.get('password')
        if username == 'admin' and password == 'admin':
            response['respCode'] = '000000'
            response['respMsg'] = 'success'
            response['user'] = 'admin'
            response['token'] = 'adminIsLogin'
    except Exception as e:
        response['respCode'] = '999999'
        response['respMsg'] = str(e)
    return JsonResponse(response)